<?php

class MenuWidget extends CWidget
{
	public $name;

	public function init()
	{

	}

	public function run()
	{
		$criteria=new CDbCriteria;
		$criteria->select="id,title,url";
		$criteria->condition="parentid=:parentid";
		$criteria->order="sort,id";
		$criteria->params= array(':parentid'=>0);
		$menus= Navigation::model()->findAll($criteria);
		$this->render('menu',array('menus'=>$menus,'name'=>$this->name));
	}
}

?>